package use;

import book.BookList;
import peration.*;

import java.util.Scanner;

public class NomalUser extends User{

    public NomalUser(String name) {
        super(name);
        array = new IOperation[]{ new Exit(),
                new FindBook(), new BorBook(),
                new FriBook()};
    }
    public int menu(){
        System.out.println("欢迎" + this.name + "来到图书系统");
        System.out.println("*******普通用户菜单*******");
        System.out.println("1. 查找图书");
        System.out.println("2. 借阅图书");
        System.out.println("3. 归还图书");
        System.out.println("0. 退出系统");
        System.out.println("**********************");
        Scanner sc = new Scanner(System.in);
        int choice =sc.nextInt();
        return choice;

    }

    @Override
    public void dowork(int choice, BookList bookList) {
        array[choice].dowork(bookList);
    }

}

